package com.ruoyi.cart.service.impl;

import com.ruoyi.cart.domain.Shop;
import com.ruoyi.cart.domain.User;
import com.ruoyi.cart.domain.UserShopsCoupon;
import com.ruoyi.cart.mapper.UserShopsCouponMapper;
import com.ruoyi.cart.service.IUserShopsCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户优惠券Service业务层处理
 *

 * @date 2023-07-23
 */
@Service
public class UserShopsCouponServiceImpl implements IUserShopsCouponService
{
    @Autowired
    private UserShopsCouponMapper userShopsCouponMapper;

    /**
     * 查询用户优惠券
     *
     * @param id 用户优惠券主键
     * @return 用户优惠券
     */
    @Override
    public UserShopsCoupon selectUserShopsCouponById(Long id)
    {
        return userShopsCouponMapper.selectUserShopsCouponById(id);
    }

    /**
     * 查询用户优惠券列表
     *
     * @param userShopsCoupon 用户优惠券
     * @return 用户优惠券
     */
    @Override
    public List<UserShopsCoupon> selectUserShopsCouponList(UserShopsCoupon userShopsCoupon)
    {
        return userShopsCouponMapper.selectUserShopsCouponList(userShopsCoupon);
    }

    /**
     * 新增用户优惠券
     *
     * @param userShopsCoupon 用户优惠券
     * @return 结果
     */
    @Override
    public int insertUserShopsCoupon(UserShopsCoupon userShopsCoupon)
    {
        return userShopsCouponMapper.insertUserShopsCoupon(userShopsCoupon);
    }

    /**
     * 修改用户优惠券
     *
     * @param userShopsCoupon 用户优惠券
     * @return 结果
     */
    @Override
    public int updateUserShopsCoupon(UserShopsCoupon userShopsCoupon)
    {
        return userShopsCouponMapper.updateUserShopsCoupon(userShopsCoupon);
    }

    /**
     * 批量删除用户优惠券
     *
     * @param ids 需要删除的用户优惠券主键
     * @return 结果
     */
    @Override
    public int deleteUserShopsCouponByIds(Long[] ids)
    {
        return userShopsCouponMapper.deleteUserShopsCouponByIds(ids);
    }

    /**
     * 删除用户优惠券信息
     *
     * @param id 用户优惠券主键
     * @return 结果
     */
    @Override
    public int deleteUserShopsCouponById(Long id)
    {
        return userShopsCouponMapper.deleteUserShopsCouponById(id);
    }

    @Override
    public List<Shop> selectShopList(Shop shop) {
        return userShopsCouponMapper.selectShopList(shop);
    }

    @Override
    public List<User> selectUserList(User user) {
        return userShopsCouponMapper.selectUserList(user);
    }
}
